<html>
<head>
<title>FieldDiff</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: tivtc_fielddiff.htm,v 1.1 2005/10/03 16:31:31 macpaille Exp $ 
-->
</head>
<body>
<h1>FieldDiff</h1>
<h2>Abstract</h2>
<b>author:</b>    tritical
<br><b>version:</b>         1.0<br>
<b>download:</b>   <a href="http://bengal.missouri.edu/~kes25c/">http://bengal.missouri.edu/~kes25c/</a>
<br><b>category:</b>    Deinterlacing &amp; Pulldown Removal
<br><b>requirements:</b>&nbsp;
<ul>
  <li>YV12 &amp; YUY2 Colorspace</li>
</ul>

<p><b>license:</b> GPL</p>

<hr size=2 width="100%" align=center>

<!-- #EndTemplate -->
<h2>Description
</h2>
<p>      FieldDiff is a simple filter that calculates a field difference metric using the
5 point metric that TFM uses and then outputs it via the debug or display options. It
operates on full frames (it differences the two fields in each frame). FieldDiff has   a version that can be used in conditional filtering called "CFieldDiff" it returns the
value to the script.</p>
<h3>Syntax</h3>
<p><code>FieldDiff</code> (clip, int <var>&quot;nt&quot;</var>, bool <var>&quot;chroma&quot;</var>, bool
<var>&quot;display&quot;</var>, bool <var>&quot;debug&quot;</var>)<br>
<code>CFieldDiff</code> (clip, int <var>&quot;nt&quot;</var>, bool <var>&quot;chroma&quot;</var>, bool
<var>&quot;debug&quot;</var>)</p>
<h3>Examples</h3>
<p>       This is a script where TFM's hints would normally be destroyed and never reach
TDecimate:</p>
<pre>mpeg2source(d2v="source.d2v")
tfm(d2v="source.d2v")
temporalsoften(3, 3, 5, 15, 2) #destroys the hints
blur(0.25) #destroys the hints
tdecimate(mode=1)</pre>
<p>To fix this, and preserve the hints (they can greatly aid decimation, especially
if using hybrid detection), use MergeHints as follows:</p>
<pre>mpeg2source(d2v="source.d2v")
tfm(d2v="source.d2v")
savedHints = last
temporalsoften(3, 3, 5, 15, 2)
blur(0.25)
MergeHints(hintClip=savedHints)
tdecimate(mode=1)</pre>
<h2>Parameters</h2>
<p><var>     nt</var> -</p>
<p>Sets the noise threshold for the field differencing.  Recommended values are         between 0 (no noise rejection) and 5.</p>
<p>Default:  3  (int)</p>
<p><var>chroma</var> -</p>
<p>Disables or enables chroma processing.</p>
<p>Default:  true  (bool)</p>
<p><var>display</var> -</p>
<p>Draws the difference value on the top left of each frame.</p>
<p>Default:  false  (bool)</p>
<p><var>debug</var> -</p>
<p>Outputs the difference value via OutputDebugString.  Use "DebugView" to&nbsp;<br>
         view the output.<br>
<br>
         Default:  false  (bool)</p>
<p><kbd>$Date: 2005/10/03 16:31:31 $</kbd>
</p>
</body>
</html>
